//
//  Pool_infoVC.m
//  duoduo
//
//  Created by wanghao on 16/10/12.
//  Copyright © 2016年 LX. All rights reserved.
//

#import "Pool_infoVC.h"
#import "PoolinfoCell.h"
#import "PayOrderVC.h"

@interface Pool_infoVC ()<UITableViewDelegate,UITableViewDataSource>
{
    UILabel * priceLabel;
    UIButton * payButton;
}
@property (nonatomic,strong) UITableView * listTableView;

@end

@implementation Pool_infoVC

- (void)viewWillAppear:(BOOL)animated
{
    self.tabBarController.tabBar.hidden=YES;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.

    [self initUI];
}

//初始化UI
- (void)initUI
{

    _listTableView =[[UITableView alloc] initWithFrame:CGRectMake(0, 0, ScreenWidth, ScreenHeight-109) style:UITableViewStylePlain];
    _listTableView.delegate = self;
    _listTableView.dataSource = self;
    _listTableView.tableFooterView.backgroundColor = LXHexColor(0xD6D6D6);
    [self.view  addSubview:_listTableView];
    [_listTableView registerNib:[UINib nibWithNibName:@"PoolinfoCell" bundle:nil] forCellReuseIdentifier:@"listcell"];
    _listTableView.tableFooterView = [[UIView alloc]init];
    _listTableView.bounces = NO;

    UIView * view = [[UIView alloc]initWithFrame:CGRectMake(0, _listTableView.frame.size.height, ScreenWidth, 45)];
    view.backgroundColor = [UIColor whiteColor];
    [self.view addSubview:view];

    priceLabel = [[UILabel alloc]initWithFrame:CGRectMake(15, 13, 100, 20)];
    priceLabel.text = @"¥ 108";
    priceLabel.textColor = [UIColor orangeColor];
    [view addSubview:priceLabel];
    payButton = [[UIButton alloc]initWithFrame:CGRectMake(ScreenWidth-100, 0, 100, 45)];
    [payButton setTitle:@"立即预定" forState:UIControlStateNormal];
    [payButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    payButton.backgroundColor = LXHexColor(0x5DCA68);
    [view addSubview:payButton];
    [payButton addTarget:self action:@selector(buyClick) forControlEvents:UIControlEventTouchUpInside];
}

//进入支付
- (void)buyClick
{
    PayOrderVC * payVC = [[PayOrderVC alloc]init];
    [self.navigationController pushViewController:payVC animated:YES];
}

#pragma mark --- UITableViewDelegate
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return 1;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    PoolinfoCell * cell = [tableView dequeueReusableCellWithIdentifier:@"listcell"];

    return cell;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    [self.listTableView deselectRowAtIndexPath:indexPath animated:NO];
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    return 838;
}



@end
